package com.shenyi.wx.dao;

import com.shenyi.core.globalDao.BaseDao;
import com.shenyi.wx.entity.CouponDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author richard.fan
 * @version 1.0
 * @date 2018/11/06
 * @desc
 * @see
 * @since 1.0
 */
@Mapper

public interface ApiCouponMapper extends BaseDao<CouponDO> {
    /**
     * 按条件查询用户优惠券
     *
     * @param params
     * @return
     */
    List<CouponDO> queryUserCoupons(Map<String, Object> params);

    /**
     * 按条件查询用户优惠券
     *
     * @param id
     * @return
     */
    CouponDO getUserCoupon(Integer id);

    /**
     * 按类型查询
     *
     * @param params
     * @return
     */
    CouponDO queryMaxUserEnableCoupon(Map<String, Object> params);

    /**
     * sendType = 1或4 的优惠券
     *
     * @param params
     * @return
     */
    List<CouponDO> queryUserCouponList(Map<String, Object> params);

    int updateUserCoupon(CouponDO CouponDO);
}
